﻿using System.ServiceModel;
using System.ServiceModel.Web;

namespace NGeo.Yahoo.PlaceFinder
{
    [ServiceContract]
    public interface IInvokePlaceFinderServices
    {
        [OperationContract(Name = "geocode0")]
        [WebGet(
            UriTemplate = "geocode?q={query}&locale={locale}&start={firstIndex}&count={maximumResults}" +
                "&offset={offsetMeters}&flags={flags}&gflags={gFlags}&appid={appId}",
            RequestFormat = WebMessageFormat.Json,
            ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare
        )]
        Response GeocodeByLocation(string query,
            string locale, int firstIndex, int maximumResults,
            int offsetMeters, string flags, string gFlags, string appId);

        [OperationContract(Name = "geocode1")]
        [WebGet(
            UriTemplate = "geocode?name={name}&locale={locale}&start={firstIndex}&count={maximumResults}" +
                "&offset={offsetMeters}&flags={flags}&gflags={gFlags}&appid={appId}",
            RequestFormat = WebMessageFormat.Json,
            ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare
        )]
        Response GeocodeByName(string name,
            string locale, int firstIndex, int maximumResults,
            int offsetMeters, string flags, string gFlags, string appId);

        [OperationContract(Name = "geocode2")]
        [WebGet(
            UriTemplate = "geocode?woeid={woeId}&locale={locale}&start={firstIndex}&count={maximumResults}" +
                "&offset={offsetMeters}&flags={flags}&gflags={gFlags}&appid={appId}",
            RequestFormat = WebMessageFormat.Json,
            ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare
        )]
        Response GeocodeByWoeId(int woeId,
            string locale, int firstIndex, int maximumResults,
            int offsetMeters, string flags, string gFlags, string appId);

        [OperationContract(Name = "geocode3")]
        [WebGet(
            UriTemplate = "geocode?line1={line1}&line2={line2}&line3={line3}" +
                "&locale={locale}&start={firstIndex}&count={maximumResults}" +
                "&offset={offsetMeters}&flags={flags}&gflags={gFlags}&appid={appId}",
            RequestFormat = WebMessageFormat.Json,
            ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare
        )]
        Response GeocodeByAddressLines(string line1, string line2, string line3,
            string locale, int firstIndex, int maximumResults,
            int offsetMeters, string flags, string gFlags, string appId);

        [OperationContract(Name = "geocode4")]
        [WebGet(
            UriTemplate = "geocode?house={houseNumber}&street={street}&unittype={unitType}&unit={unit}" +
                "&xstreet={crossStreet}&postal={postal}&level4={level4}&level3={level3}&level2={level2}" +
                "&level1={level1}&level0={level0}&locale={locale}&start={firstIndex}&count={maximumResults}" +
                "&offset={offsetMeters}&flags={flags}&gflags={gFlags}&appid={appId}",
            RequestFormat = WebMessageFormat.Json,
            ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare
        )]
        Response GeocodeByOther(string houseNumber, string street, string unitType, string unit, string crossStreet, string postal,
            string level4, string level3, string level2, string level1, string level0,
            string locale, int firstIndex, int maximumResults,
            int offsetMeters, string flags, string gFlags, string appId);

        [OperationContract(Name = "geocode5")]
        [WebGet(
            UriTemplate = "geocode?location={location}&locale={locale}&start={firstIndex}&count={maximumResults}" +
                "&offset={offsetMeters}&flags={flags}&gflags={gFlags}&appid={appId}",
            RequestFormat = WebMessageFormat.Json,
            ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare
        )]
        Response ReverseGeocode(string location,
            string locale, int firstIndex, int maximumResults,
            int offsetMeters, string flags, string gFlags, string appId);

    }
}
